package com.neuedu.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neuedu.dao.AdminDao;
import com.neuedu.model.Admin;
import com.neuedu.service.AdminService;

//配置一个spring的服务类，把业务实现类交给spring进行管理，把Spring完成依赖注入
@Service
public class AdminServiceImpl implements AdminService {

	// 织如入-依赖注入
	@Autowired
	private AdminDao adminDao;

	public void setUserMessageDao(AdminDao adminDao) {
		this.adminDao = adminDao;
	}
	
	@Override
	public int countAdmin() {
		// TODO Auto-generated method stub
		return adminDao.countAdmin();
	}

	@Override
	public List<Admin> findAll(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return adminDao.findAll(map);
	}

	@Override
	public int addAdmin(Admin u) {
		// TODO Auto-generated method stub
		return adminDao.addAdmin(u);
	}

	@Override
	public int updateAdmin(Admin u) {
		// TODO Auto-generated method stub
		return adminDao.updateAdmin(u);
	}

	@Override
	public int deleteAdmin(int id) {
		// TODO Auto-generated method stub
		return adminDao.deleteAdmin(id);
	}
	@Override
	public Admin findAdminByName(Admin u) {
		// TODO Auto-generated method stub
		return adminDao.findAdminByName(u);
	}

}
